package com.basin.common.core.exception;

/**
 * @author: Sam ZHONG | sammy1997@aliyun.com
 */
public final class BasinAssert {
    private BasinAssert() {
    }

    public static <EX extends BasinExViewVO> void isTrue(boolean expression, EX exCode) {
        if (!expression) {
            throw new BasinException(exCode);
        }
    }

    public static void isTrue(boolean expression, String message) {
        if (!expression) {
            throw new BasinException(message);
        }
    }

    public static void isTrue(boolean expression) {
        isTrue(expression, "[basin-assert] caused by the expression is true");
    }
}
